import Vue from 'vue'
import Vuex from 'vuex'
import {playMode} from "./assets/js/config.js"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isShowNav:true,
    isShowBtmNav:true,
    userName:"111",
    isExperience:false,
    mode:playMode.sequence,
    stopPlay:true,
    stopPlayState:"runnig",
    isShowSongdetails: false,
    token:localStorage.getItem("token")?localStorage.getItem("token"):"",

    idx:localStorage.getItem("mid")?localStorage.getItem("mid"):""
  },
  mutations: {
    NavShow(state,bool){
      state.isShowNav = bool.top
      state.isShowBtmNav = bool.btm
    },
    saveUserName(state,data){
      state.userName = data
    },
    saveToken(state,data){
      state.token = data
      localStorage.setItem("token",data)
    },
    saveIsExperience(state){
      state.isExperience=!state.isExperience;
    },
    changeStopPlay(state,data){
      state.stopPlay = data;
    },
    changeStopPlayState(state,data){
      state.stopPlayState = data;
    },
    songdetails(state) {
			state.isShowSongdetails = !state.isShowSongdetails
    }
  },
  actions: {
		
	}
})